package com.dhms.vostok1.data

import android.bluetooth.BluetoothDevice
import java.util.*

data class Feature(
    val collects: List<String>
)

data class BLEDevice(
    val device: BluetoothDevice,
    val type: BLEDeviceType,
    var productId: String,
    var model: String,
    var macAddress: String,
    var feature: Feature?,
    var softwareVersions: Map<String, String>?,
    var hwVersionsNum: Int?,
    var attr: Float?,
    val hwVersion: String? = null,
//    val numSwImage: Int? = 0,
    val swFourcc: LongArray? = null,
    val swFourccVersions: IntArray? = null,
    var power: Float? = null,
    val powerLevel: Float? = null
)

enum class BLEDeviceType(val typeId: Int) {
    ZHENG_CHAO_SPC_DEVICE(0xFE),
    DHMS_SENSOR(0x01),
    DHMS_GATEWAT(0x02),
    DHMS_SPC_DEVICE(0x03),
    DHMS_BEACON(0x04),
    UNKNOWN(
        0xFF
    );

    companion object {
        fun from(typeId: Int): BLEDeviceType = BLEDeviceType.values().first { it.typeId == typeId }
    }
}

data class ManufacturerData(
    val uuid: UUID,
    val major: Int,
    val minor: Int
)